package com.moxiao.yfjh.module.blind.dal.mysql.album;

import com.moxiao.yfjh.module.blind.controller.admin.album.vo.BlindMemberAlbumExportReqVO;
import com.moxiao.yfjh.module.blind.controller.admin.album.vo.BlindMemberAlbumPageReqVO;
import java.util.*;

import com.moxiao.yfjh.framework.common.pojo.PageResult;
import com.moxiao.yfjh.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.moxiao.yfjh.framework.mybatis.core.mapper.BaseMapperX;
import com.moxiao.yfjh.module.blind.dal.dataobject.album.BlindMemberAlbumDO;
import org.apache.ibatis.annotations.Mapper;
import com.moxiao.yfjh.module.blind.controller.admin.album.vo.*;

/**
 * 相亲会员相册 Mapper
 *
 * @author mx
 */
@Mapper
public interface BlindMemberAlbumMapper extends BaseMapperX<BlindMemberAlbumDO> {

    default PageResult<BlindMemberAlbumDO> selectPage(BlindMemberAlbumPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BlindMemberAlbumDO>()
                .eqIfPresent(BlindMemberAlbumDO::getUserId, reqVO.getUserId())
                .eqIfPresent(BlindMemberAlbumDO::getUrl, reqVO.getImgUrl())
                .betweenIfPresent(BlindMemberAlbumDO::getCreateTime, reqVO.getCreateTime())
                .notLike(BlindMemberAlbumDO::getAuditStatus,(byte)2)
                .orderByAsc(BlindMemberAlbumDO::getId));
    }

    default List<BlindMemberAlbumDO> selectList(BlindMemberAlbumExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<BlindMemberAlbumDO>()
                .eqIfPresent(BlindMemberAlbumDO::getUserId, reqVO.getUserId())
                .eqIfPresent(BlindMemberAlbumDO::getUrl, reqVO.getImgUrl())
                .betweenIfPresent(BlindMemberAlbumDO::getCreateTime, reqVO.getCreateTime())
                .orderByAsc(BlindMemberAlbumDO::getId));
    }

}
